<template>
	<view>
		<picker mode="selector" :range="options" @change="onPickerChange">
			<view class="picker">
				<text>{{ selectedOption || '请选择一个选项' }}</text>
			</view>
		</picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				options: ['选项1', '选项2', '选项3', '选项4'], // Picker options
				selectedOption: '', // Store selected option
			};
		},
		methods: {
			onPickerChange(e) {
				const index = e.detail.value; // Get the selected index
				this.selectedOption = this.options[index]; // Get the corresponding value
			},
		},
	};
</script>

<style scoped>
	.picker {
		padding: 10px;
		border: 1px solid #ccc;
		background-color: #f5f5f5;
	}
</style>